# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Container.V1.Model.IPEndpointsConfig do
  @moduledoc """
  IP endpoints configuration.

  ## Attributes

  *   `authorizedNetworksConfig` (*type:* `GoogleApi.Container.V1.Model.MasterAuthorizedNetworksConfig.t`, *default:* `nil`) - Configuration of authorized networks. If enabled, restricts access to the control plane based on source IP. It is invalid to specify both Cluster.masterAuthorizedNetworksConfig and this field at the same time.
  *   `enablePublicEndpoint` (*type:* `boolean()`, *default:* `nil`) - Controls whether the control plane allows access through a public IP. It is invalid to specify both PrivateClusterConfig.enablePrivateEndpoint and this field at the same time.
  *   `enabled` (*type:* `boolean()`, *default:* `nil`) - Controls whether to allow direct IP access.
  *   `globalAccess` (*type:* `boolean()`, *default:* `nil`) - Controls whether the control plane's private endpoint is accessible from sources in other regions. It is invalid to specify both PrivateClusterMasterGlobalAccessConfig.enabled and this field at the same time.
  *   `privateEndpoint` (*type:* `String.t`, *default:* `nil`) - Output only. The internal IP address of this cluster's control plane. Only populated if enabled.
  *   `privateEndpointSubnetwork` (*type:* `String.t`, *default:* `nil`) - Subnet to provision the master's private endpoint during cluster creation. Specified in projects/*/regions/*/subnetworks/* format. It is invalid to specify both PrivateClusterConfig.privateEndpointSubnetwork and this field at the same time.
  *   `publicEndpoint` (*type:* `String.t`, *default:* `nil`) - Output only. The external IP address of this cluster's control plane. Only populated if enabled.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authorizedNetworksConfig =>
            GoogleApi.Container.V1.Model.MasterAuthorizedNetworksConfig.t() | nil,
          :enablePublicEndpoint => boolean() | nil,
          :enabled => boolean() | nil,
          :globalAccess => boolean() | nil,
          :privateEndpoint => String.t() | nil,
          :privateEndpointSubnetwork => String.t() | nil,
          :publicEndpoint => String.t() | nil
        }

  field(:authorizedNetworksConfig, as: GoogleApi.Container.V1.Model.MasterAuthorizedNetworksConfig)

  field(:enablePublicEndpoint)
  field(:enabled)
  field(:globalAccess)
  field(:privateEndpoint)
  field(:privateEndpointSubnetwork)
  field(:publicEndpoint)
end

defimpl Poison.Decoder, for: GoogleApi.Container.V1.Model.IPEndpointsConfig do
  def decode(value, options) do
    GoogleApi.Container.V1.Model.IPEndpointsConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Container.V1.Model.IPEndpointsConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
